package com.sky.controller.user;

import com.sky.constant.ShopStatusConstant;
import com.sky.result.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author : jiang
 * @date : 2023/10/17 17:46
 */
@RestController("userShopController")
@RequestMapping("/user/shop")
public class ShopController {
    @Autowired
    private RedisTemplate<String,Integer> redisTemplate;

    /**
     * 查看店铺状态
     * @return
     */
    @GetMapping("/status")
    public Result getShopStatus(){
        Integer status = redisTemplate.opsForValue().get(ShopStatusConstant.KEY);
        return Result.success(status);
    }
}
